package com.woniuxy.woniufp.common.model.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder  //方便构建对象
@ToString
@ApiModel("用户注册DTO")
public class UserRegistDto {
    @NotBlank(message = "用户名不能为空.")   //不能为null  也不能为 ""
    @ApiModelProperty("用户名")
    private String userName;
    @NotBlank(message = "手机号不能为空.")
    @Pattern(regexp="^1[3-9]\\d{9}$",message = "必须满足手机号的规则.")
    @ApiModelProperty("手机号")
    private String phone ;
    @Pattern(regexp = "^\\w{6,}",message = "密码不能少于六位字符.")
    @NotBlank(message = "密码不能为空.")
    @ApiModelProperty("密码")
    private String pwd ;
}
